public with sharing class WBEnquiryController {

    public List<WBContent__c> contents{get;set;}
    public List<WBContent__c> contents1{get;set;}
    public List<WBContent__c> contents2{get;set;}
    public List<WBContent__c> contents3{get;set;}
    public List<WBContent__c> contents4{get;set;}
    
    public Integer half{get{return (contents.size() + 1)/4;}set;}
    
    
    public void Excute(){
        //keyword = Apexpages.currentPage().getParameters().get('keyword');             
        contents = [SELECT source__c ,created_at__c,id__c,text__c,uid__c,user__c,mid__c FROM WBContent__c Where Keyword__c='a0Ad0000007b4KrEAI' limit 20 ];
        contents1 = contents;  
        contents2 = [SELECT source__c ,created_at__c,id__c,text__c,uid__c,user__c,mid__c FROM WBContent__c Where Keyword__c='a0Ad0000007bEV9EAM' limit 20 ];  
        contents3 = [SELECT source__c ,created_at__c,id__c,text__c,uid__c,user__c,mid__c FROM WBContent__c Where Keyword__c='a0Ad0000007bEBxEAM' limit 20 ];  
        contents4 = [SELECT source__c ,created_at__c,id__c,text__c,uid__c,user__c,mid__c FROM WBContent__c Where Keyword__c='a0Ad0000007bFLkEAM' limit 20 ];                         
    }
    
    public WBEnquiryController(){
        Excute();
    }
   
    public string keyword {get;set;}
    // Reply Comment
    public String replyResult {get;set;}
    public String wbid{get;set;}
    public String content{get;set;}
    public void ReplyComment(){
       
            wbid = ApexPages.currentPage().getParameters().get('reply_wbid');
            content= ApexPages.currentPage().getParameters().get('reply_content');
            
            WB_OpenApi.WB_Comment_Create_In wbc_in = new WB_OpenApi.WB_Comment_Create_In();
            wbc_in.id = wbid ;
            wbc_in.comment = content ;
            String jsonResult = wbc_in.toRequestURL();
            
            if( jsonResult.contains( content) ){
                replyResult = '【Reply Content】: '+content;
            }else{
                replyResult = 'reply failure!';
            }
    }
    
}